﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Cadastro da Arma
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <link rel="Stylesheet" type="text/css" href="../../Content/edit.css" />
    <h2>
        Cadastro da Arma</h2>
    <% using (Html.BeginForm("Edit", "Weapons", FormMethod.Post, new { enctype = "multipart/form-data" }))
       { %>
    <%: Html.ValidationSummary()%>
    <table>
        <tr>
            <td>
                <input type="submit" value="Gravar" />
                <input type="button" value="Voltar" onclick="document.location.href='<%: Url.Action("Index", "Weapons") %>'" />
            </td>
        </tr>
    </table>
    <table>
        <tr>
            <td class="label">
                Nome da Arma:
            </td>
            <td>
                <%: Html.TextBox("Name")%>
            </td>
            <td class="label" style="text-align: center;">
                Imagem Atual
            </td>
        </tr>
        <tr valign="top">
            <td class="label">
                Descrição:
            </td>
            <td>
                <%: Html.TextArea("Description")%>
                <br />
                <table>
                    <tr>
                        <td>
                            Ativo
                        </td>
                        <td>
                            <%: Html.CheckBox("Enabled")%>
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <img src="<%= Model != null && !string.IsNullOrEmpty(Model.Image) ? Model.Image : "../../images/not_found.jpg" %>"
                    alt="" />
                <br />
                <div align="center">
                    <input type="file" name="ImageUploaded" title="Busca a foto da arma" value="Buscar foto" />
                </div>
            </td>
        </tr>
    </table>
    <% } %>
</asp:Content>
